package mk.jug.academy.service;

import mk.jug.academy.model.Page;
import mk.jug.academy.model.Sponsor;
import mk.jug.academy.model.SponsorStatus;
import mk.jug.academy.model.Supporter;

/**
 * Contract defining the services available regarding the
 * {@link Sponsor} entity in the system.
 *
 * @author Ice.Penov
 */
public interface SponsorService {
	
	/**
	 * Register a {@link Sponsor}.
	 */
	void register(Sponsor sponsor);

	/**
	 * Activates a {@link Sponsor}.
	 */
	void activate(Sponsor sponsor);
	
	/**
	 * Deletes(soft) a {@link Sponsor}.
	 */
	void delete(Sponsor sponsor);
	
	/**
	 * Gets all sponsors with {@link SponsorStatus#REGISTERED}, ordered by their rating,
	 * in a paged manner.
	 */
	Page<Sponsor> listRegistered(int pageNumber, int itemsPerPage);
	
	/**
	 * Gets all sponsors with {@link SponsorStatus#ACTIVE}, ordered by their rating,
	 * in a paged manner.
	 */
	Page<Sponsor> listActive(int pageNumber, int itemsPerPage);

	/**
	 * Gets all sponsors with {@link SponsorStatus#DELETED}, ordered by their rating,
	 * in a paged manner.
	 */
	Page<Sponsor> listDeleted(int pageNumber, int itemsPerPage);
	
	/**
	 * Checks whether the {@link Sponsor} with the specified email exists.
	 */
	boolean exists(String email);
	
	/**
	 * Finds the {@link Supporter} by email.
	 */
	Sponsor findByEmail(String email);
	
	/**
	 * Gets the {@link Sponsor} by its ID.
	 */
	Sponsor load(Long id);
	
}